<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class dangky_model extends CI_Model
{
	function __construct(){
        parent::__construct();
	}
	
	function check_name()
	{
		$user = $this->input->post('username');	
		$pass = $this->input->post('password');	
		
		$this->db->select('username','password');
		$this->db->where('username',$user);
		$query = $this->db->get('member');
		return $query->row();
	}
	
	function save()
	{
		$data = array(
			'mLogin' => $this->input->post('username') ,
			'password' => $this->input->post('password'),
			'mEmail' => $this->input->post('email') ,
			'mFullName' => $this->input->post('fullname') ,
			'mAddress' => $this->input->post('address') ,
			'mTel' => $this->input->post('tell') ,
			'mAgree' => $this->input->post('agree') ,
			'lastEdit' =>  date("Y-m-d H:i:s")
		  ) ;
		  if($this->db->insert('member',$data)){
			  return true;
		  }else
		  	return false;
	}
}
?>
